<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ include file="/WEB-INF/jsp/includes/common.jsp"%>
<html>
	<head>
		<%@ include file="/WEB-INF/jsp/includes/head.jsp"%>
		<script type="text/javascript" src="${ctx }/js/lib/jquery.validate.js"></script>
		<script type="text/javascript" src="${ctx }/js/lib/jquery.validate.messages_cn.js"></script>
		<script type="text/javascript" src="${ctx }/js/base/validateinfo.js"></script>
		<script type="text/javascript" src="${ctx }/js/lib/jquery.ajaxfileupload.js"> </script>
		<script type="text/javascript" src="${ctx }/js/award/awardlist.js"></script>
	</head>
	<body>
		<%@ include file="/WEB-INF/jsp/includes/logo.jsp"%>
		<div class="container">
			<div class="main clearfix">
					<%@ include file="/WEB-INF/jsp/includes/nav.jsp"%>
				<div class="container2 fl">
					<div class="main">
						<h4><span><a href="${ctx }/activity/index.do">活动列表</a>&nbsp;>&nbsp;</span><span class="fb"><a href="${ctx }/award/index.do?activeId=${activeId}">活动奖品</a></span></h4>
						<input type="hidden" id="activeId" value=${activeId } />
						<input type="hidden" name="awID" id="awID"/>
						<div class="hd mt10 clearfix">
							<c:if test="${actFaceStatus==1 or actFaceStatus==4 }">
								<a href="${ctx }/award/toSavePage.do?activeId=${activeId }" class="btn-add-award btn btn1 fl mr20">添加奖品</a>
								<a href="${ctx }/award/toConfigDiscPage.do?activeId=${activeId }" class="btn-config-award btn btn1 fl">配置摇奖盘</a>
							</c:if>
						</div>
						<div class="cont mt10">
							<table cellspacing="0" border="1" width="100%">
								<thead>
									<tr>
										<th width="40">编号</th>
										<th width="150">奖品名称</th>
										<th width="150">奖品图片</th>
										<th width="70">奖品类型</th>
										<th width="70">奖品分类</th>
										<th width="70">数量</th>
										<th width="70">剩余奖品</th>
										<th width="">操作</th>
									</tr>
								</thead>
								<c:if test="${page.total>0 }">
								<nad:table dataList="${page.dataList }" trans="${trans}">
								<tbody>
									<nad:row>
											<c:if test="${DATALIST_CURRENTROW%2==0 }">
												<tr class="odd">
											</c:if>
											<c:if test="${DATALIST_CURRENTROW%2==1 }">
												<tr class="even">
											</c:if>
											<td>${id}</td>
											<td>
												<span>${name }</span>
											</td>
											
											<td><img src="${image }"  width="90" height="90" /></td>
											<td><nad:col name="type"/></td>
											<td><nad:col name="channel"/></td>
											<td>${maxNum }</td>
											<td>${currNum }</td>
											<td>
												<span>
												<c:if test="${actFaceStatus==1 or actFaceStatus==4 }">
													<a href="${ctx }/award/toUpdatePage.do?awardId=<nad:col name="id"/>&activeId=${activeId }" >编辑</a>
													<a href="javascript:void(0);" class="is-delete" activeId="${activeId }">删除</a>
												</c:if>
												</span>
												<span>
													<a href="${ctx }/award/toAwardDetailList.do?type=${type }&awardId=<nad:col name="id"/>&activeId=${activeId }">奖品明细</a>
													<a href="${ctx }/award/toAwardConfigChance.do?awardId=<nad:col name="id"/>&activeId=${activeId }">中奖方式</a>
												</span>
												<span>
													<c:if test="${actFaceStatus==1 or actFaceStatus==4 }">
														<c:if test="${maxNum==0 }">
															<a href="javascript:void(0);" class="storage_link" id="putInWarehouse" awardType="${type }" awardId="${id }">奖品入库</a>
														</c:if>
														<c:if test="${maxNum>0 }">
															<a href="javascript:void(0);" class="add-more-award-link" awardType="${type }" awardId="${id }" gnum="${gNum}">追加奖品</a>
														</c:if>
													</c:if>
												</span>
											</td>
											</tr>
										</nad:row>
								</tbody>
								</nad:table>
								</c:if>
								<c:if test="${page.total<=0 }">
									<tr class="no-results">
										<td colspan="100%">未查询到结果！</td>
									</tr>
								</c:if>
							</table>
						</div>
						<div class="ft mt10 clearfix pageno">
							<c:if test="${page.total>0 }">
								<nad:pagebar page="${page }" action="${ctx }/award/index.do?activeId=${activeId }" />
							</c:if>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<!-- 弹出层 -->
		<!-- G币奖品入库 -->
		<div id="storageGold" title="G币奖品入库" class="hidden">
			<form action="" method="" id="gbStoreForm">
				<p class="validate-tips">${error }</p>
				<fieldset>
					<p class="validate-tips hidden"></p>
					<p class="item">
						<label for="award-num"><i>*</i>奖品数量：</label>
						<input type="text" name="gbnum" id="gbnum"  class="text ui-widget-content ui-corner-all" />
					</p>
					<p class="item">
						<label for="award-gold"><i>*</i>奖品G币额：</label>
						<input type="text" name="gbAmount" id="gbAmount" class="text ui-widget-content ui-corner-all" />
					</p>
					<p class="msg">
						<label>当前可用G币：</label>
						<em id="availableGb"></em>
					</p>
				</fieldset>
			</form>
		</div>
		<!-- 经验值奖品入库 -->
		<div id="storageExperience" title="经验值奖品入库" class="hidden">
			<form action="" method="" id="experienceStoreForm">
				<p class="validate-tips">${error }</p>
				<fieldset>
					<p class="validate-tips hidden"></p>
					<p class="item">
						<label for="award-num"><i>*</i>奖品数量：</label>
						<input type="text" name="experienceNum" id="experienceNum" class="text ui-widget-content ui-corner-all" />
					</p>
					<p class="item">
						<label for="award-gold"><i>*</i>经验值额度：</label>
						<input type="text" name="experienceAmount" id="experienceAmount" class="text ui-widget-content ui-corner-all" />
					</p>
				</fieldset>
			</form>
		</div>
		<!-- 实物奖品入库 -->
		<div id="storageNoneVirtual" title="实物奖品入库" class="hidden">
			<form  id="entityStoreForm" onsubmit="return false">
				<p class="validate-tips">${error }</p>
				<fieldset>
					<p class="validate-tips hidden"></p>
					<p class="item">
						<label for="award-num"><i>*</i>奖品数量：</label>
						<input type="text" name="entitynum" id="entitynum" class="text ui-widget-content ui-corner-all" />
					</p>
				</fieldset>
			</form>
		</div>
		<!-- 虚拟点卡奖品入库 -->
		<div id="storageVirtual" title="虚拟点卡奖品入库" class="hidden">
			<form id="virtualStoreForm" onsubmit="return false">
				<p class="validate-tips">${error }</p>
				<fieldset>
					<p class="validate-tips hidden"></p>
					<p class="item">
						<label for="award-num"><i>*</i>奖品文本：</label>
						<input type="file" name="virtualTxt" id="virtualTxt"  class="text ui-widget-content ui-corner-all" />
						<em>请选择大小小于100KB，文件名不为中文的txt文档</em>
					</p>
				</fieldset>
			</form>
		</div>
		<!-- 追加奖品 -->
		<div id="addMoreAward" title="追加奖品" class="hidden">
			<form  onsubmit="return false">
				<p class="validate-tips">${error }</p>
				<fieldset>
					<input type="hidden" name="typeHidden" id="typeHidden" />
					<center><p class="item" id="gnum"></p></center>
					<p class="item">
						<label for="award-num">奖品数量：</label>
						<input type="text" name="awardNum" id="awardNum"  class="text ui-widget-content ui-corner-all" />
					</p>
				</fieldset>
			</form>
		</div>
	</body>
</html>


